package com.example.demo.security.service;

import com.example.demo.security.bean.SecurityAdminRoleBean;
import com.example.demo.security.bean.SecurityRoleBean;
import com.example.demo.security.repository.SecurityAdminRoleRepository;
import com.example.demo.service.BaseService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

@Service
public class SecurityAdminRoleService extends BaseService<SecurityAdminRoleBean, SecurityAdminRoleRepository> {
    public Set<SecurityAdminRoleBean> createAdminRoleBean(List<SecurityRoleBean> list) {
        return list.parallelStream().map(b -> {
            SecurityAdminRoleBean bean = new SecurityAdminRoleBean();
            bean.setSecurityRoleBean(b);
            return bean;
        }).collect(Collectors.toSet());
    }
}
